package com.mapbased.da;

import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.util.Map;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: </p>
 *
 * @author chy(Baily)
 * @version 1.0
 */
public class Main
{
    public static void main(String[] ss)
    {

        org.springframework.context.support.ClassPathXmlApplicationContext
            ctx=new ClassPathXmlApplicationContext(new String[]
            {
            "dm.xml"
        });

        MetaFactory m=(MetaFactory)ctx.getBean("metaFactory");
       // m.get("select").query(new java.util.HashMap());
        Map in=new java.util.HashMap();
        in.put("id",new Integer(2));
        in.put("catalogId",new String[]
               {"4344"});
        in.put("userId",new String[]
               {"4344"});

       in.put("displayName","srfsdhgrtjhrtyhtrh");
       in.put("gender","1");
        /*  <entry indexkey="1" name="userId">                    </entry>
                    <entry indexkey="2" name="displayName">                    </entry>
                    <entry indexkey="3" name="gender">                    </entry>
                    <entry indexkey="4" name="imageIndex">                    </entry>
                    <entry indexkey="5" name="sign">                    </entry>
*/


        m.get("InserSubject").update(in);
        m.get("InsertUser").update(in);

        m.get("ListSubjects").query(new java.util.HashMap());

        FeatureMeta meta=m.get("seqSubjectId");
        long cr=System.currentTimeMillis();
        for(int i=0;i < 1000;i++)
        {
            System.out.println(meta.queryForObject(in));
        }
        System.out.println(System.currentTimeMillis() - cr);

    }

}
